<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript">

  // Write your code in the same way as for native WebSocket:
  var ws = new WebSocket('ws://localhost:8887');
  ws.onopen = function() {
    ws.send('Hello');  // Sends a message.
  };
  ws.onmessage = function(e) {
    // Receives a message.
  };
  ws.onclose = function() {
  };

</script>
</head>
</html>